package cn.tedu.uep.petCircle.controller;

import cn.tedu.uep.base.response.JsonResult;
import cn.tedu.uep.petCircle.pojo.dto.PetCircleParam;
import cn.tedu.uep.petCircle.pojo.dto.PetCircleQuery;
import cn.tedu.uep.petCircle.pojo.vo.PetCircleVo;
import cn.tedu.uep.petCircle.service.PetCircleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/PetCircle")
public class PetCircleController {
    @Autowired
    PetCircleService PetCircleService;


    @PostMapping ("/v1/petCircle/insert")
    public JsonResult insertpet_circle(PetCircleParam petCircleParam ){
        PetCircleService.insertpet_circle(petCircleParam);
        log.debug("新增宠圈数据 pet_circleParam={}",petCircleParam);
        return JsonResult.ok();
    }
    @PostMapping("/v1/petCircle/delete")
    public JsonResult deletepet_circle(PetCircleParam petCircleParam){
        PetCircleService.deletepet_circle();
        log.debug("删除宠圈数据 pet_circleQuery={}",petCircleParam);
        return JsonResult.ok();
    }
    @GetMapping("/v1/petCircle/select")
    public JsonResult selectpet_circle(PetCircleQuery petCircleQuery){
        List<PetCircleVo> petCircleVoList = PetCircleService.selectpet_circle(petCircleQuery);
        log.debug("查询宠圈数据 petCircleQuery={}",petCircleQuery);
        return JsonResult.ok(petCircleVoList);
    }
}
